package com.curryfishinterface.Controller;

import com.curryfish.curryfishclientsdk.Model.User;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/name")
public class UserController {

    @GetMapping("/")
    public String getNameByGet(@RequestParam String name){
        return "Get 名称为：" + name;
    }

    @PostMapping("/user")
    public String getUserByPost(@RequestBody User user, HttpServletRequest request){
        String result = "Post 用户名为：" + user.getUsername();
        //调用成功后，次数 +1
        return result;
    }

    @PostMapping("/")
    public String getNameByPost(@RequestParam String name){

        return "Post 名称为：" + name;
    }
}
